/**
 * @program: clms-second
 * @description: 汽车类型控制层
 * @author: mitu_echo
 * @create: 2021-07-24 20:36
 **/

package com.second.lease.controller;

import com.second.common.pojo.R;
import com.second.lease.pojo.entity.CarType;
import com.second.lease.pojo.vo.CarTypeVO;
import com.second.lease.service.CarTypeService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/cartype")
public class CarTypeController {

    @Autowired
    private CarTypeService carTypeService;

    @ApiOperation("/查询车辆类型")
    @RequestMapping("/showAllCarType")
    public R showAllCarType(CarTypeVO carTypeVO) {

        return carTypeService.showAllCarType(carTypeVO);
    }

    @ApiOperation("/更新车辆类型")
    @RequestMapping("/updateCarType")
    public R updateCarType(@RequestBody CarType carType) {

        return carTypeService.updateCarType(carType);
    }

    @ApiOperation("/新增车辆类型")
    @RequestMapping("/addCarType")
    public R addCarType(@RequestBody CarType carType) {

        return carTypeService.addCarType(carType);
    }

    @ApiOperation("/删除车辆类型")
    @RequestMapping("/deleteCarType")
    public R deleteCarType(Integer id) {
        return carTypeService.deleteCarType(id);
    }
}
